package org.eerbaar.parser.core.def.impl;

import org.eerbaar.parser.core.def.Symbol;

public abstract class DefaultSymbol implements Symbol {

    private final String name;

    public DefaultSymbol(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }

    @Override
    public String toDebugString() {
        if (name.length() > 2) {
            return name.substring(0, 1);
        }
        return name;
    }

    @Override
    public String toString() {
        return name;
    }

}
